-
Notifications
You must be signed in to change notification settings - Fork 146
Implement preprocessor directive #ifndef #158
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
+34
−5
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
|
Thank @ChAoSUnItY for contributing! |
ChAoSUnItY
added a commit
to ChAoSUnItY/shecc
that referenced
this pull request
Apr 17, 2025
Previously in PR sysprog21#158, #ifndef is not sufficient enough to address optional file inclusion issue in shecc, since shecc currently includes file before tokenization / parsing pass. Therefore, "#pragma once" is the only way to prevent recursively file inclusion. Although "#pragma once" is not standard anywhere in C standards, major C compilers such as GCC and Clang do support this preprocessor directive.
ChAoSUnItY
added a commit
to ChAoSUnItY/shecc
that referenced
this pull request
Apr 17, 2025
Previously in PR sysprog21#158, #ifndef is not sufficient enough to address optional file inclusion issue in shecc, since shecc currently includes file before tokenization / parsing pass. Therefore, "#pragma once" is the only way to prevent recursively file inclusion. Although "#pragma once" is not standard anywhere in C standards, major C compilers such as GCC and Clang do support this preprocessor directive.
ChAoSUnItY
added a commit
to ChAoSUnItY/shecc
that referenced
this pull request
Apr 17, 2025
Previously in PR sysprog21#158, #ifndef is not sufficient enough to address optional file inclusion issue in shecc, since shecc currently includes file before tokenization / parsing pass. Therefore, "#pragma once" is the only way to prevent recursively file inclusion. Although "#pragma once" is not standard anywhere in C standards, major C compilers such as GCC and Clang do support this preprocessor directive.
ChAoSUnItY
added a commit
to ChAoSUnItY/shecc
that referenced
this pull request
Apr 19, 2025
Previously in PR sysprog21#158, #ifndef is not sufficient enough to address optional file inclusion issue in shecc, since shecc currently includes file before tokenization / parsing pass. Therefore, "#pragma once" is the only way to prevent recursively file inclusion. Although "#pragma once" is not standard anywhere in C standards, major C compilers such as GCC and Clang do support this preprocessor directive.
ChAoSUnItY
added a commit
to ChAoSUnItY/shecc
that referenced
this pull request
Apr 22, 2025
Previously in PR sysprog21#158, #ifndef is not sufficient enough to address optional file inclusion issue in shecc, since shecc currently includes file before tokenization / parsing pass. Therefore, "#pragma once" is the only way to prevent recursively file inclusion. Although "#pragma once" is not standard anywhere in C standards, major C compilers such as GCC and Clang do support this preprocessor directive.
ChAoSUnItY
added a commit
to ChAoSUnItY/shecc
that referenced
this pull request
Apr 22, 2025
Previously in PR sysprog21#158, #ifndef is not sufficient enough to address optional file inclusion issue in shecc, since shecc currently includes file before tokenization / parsing pass. Therefore, "#pragma once" is the only way to prevent recursively file inclusion. Although "#pragma once" is not standard anywhere in C standards, major C compilers such as GCC and Clang do support this preprocessor directive.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
To prevent redefinition or serving other purposes, we sometimes need to negate the result of
defined, however, currently shecc does support neither negation operator in macro scope, e.g.!defined(SOME_MACRO), nor#ifndef. Thus, in this PR, we introduce preprocessor directive#ifndefto solve this issue without massively refactoring frontend codebase (since frontend refactoring is WIP).